package cn.wolfcode.trip.base.domain;

import cn.wolfcode.trip.base.util.JsonUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.*;

@Setter
@Getter
public class StrategyComment extends BaseDomain{

    public static final Integer TYPE_DISABLE = -1;//禁用
    public static final Integer TYPE_NORMAL = 0;//正常
    public static final Integer TYPE_RECOMMEND  = 1;//推荐
    //评论人
    private User user;

    //评论时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date createTime;

    //评论内容
    private String content;

    //评论图片
    private String imgUrls;

    //星星数量
    private Integer starNum;

    //攻略
    private Strategy strategy;

    //状态
    private Integer state;

    //头条推荐时间
    private Date commendTime;

    public String getJson(){
        Map<String,Object> map = new HashMap<>();
        map.put("id",id);
        map.put("state",state);

        return JsonUtil.toJsonString(map);
    }

}